package com.xbongbong.pro.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;

/**
 * @Author shian
 * @create 2019-08-07 17:20
 * @Description
 */
@Getter
public enum SearchCustomerEnum {

    /**
     * 搜客模糊查询,字段同步我的线索列表字段
     */
    BUSINESS_NAME("text_1", "businessName", "enum.searchCustomer.attrName.business_name"),
    CONTACT_INFORMATION("subForm_1", "contactInformation", "enum.searchCustomer.attrName.contact_information"),
    ADDRESS("address_1", "address", "enum.searchCustomer.attrName.address"),
    CONTACT("array_1", "contact", "enum.searchCustomer.attrName.contact"),
    FOLLOW_UP("other_1","followUp", "enum.searchCustomer.attrName.follow_up")
    ;
    private String attr;

    private String alias;

    private String attrName;

    SearchCustomerEnum(String attr, String alias, String attrName) {
        this.attr = attr;
        this.alias = alias;
        this.attrName = attrName;
    }

    /**
     * 获取全部枚举值
     *
     * @return List<String>
     */
    public static List<SearchCustomerEnum> getAllEnum() {
        List<SearchCustomerEnum> list = new ArrayList<>();
        for (SearchCustomerEnum cache : values()) {
            list.add(cache);
        }
        return list;
    }

    public String getAttrName() {
        return I18nMessageUtil.getMessage(attrName);
    }
}
